package demo.java.java8.Lambdas.demoDate;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.Month;
import java.time.temporal.ChronoField;

public class MyDate {

	public static void main(String[] args) {
//		LocalDate date=LocalDate.of(2014, 3, 18);
//		LocalDate date=LocalDate.now();
		LocalDate date=LocalDate.parse("2014-03-18");
		LocalTime time=LocalTime.parse("13:45:20");
		LocalDateTime dt1=LocalDateTime.of(2014, Month.MARCH,18,13,45,20);
		LocalDateTime dt2=LocalDateTime.of(date,time);
		LocalDateTime dt3=date.atTime(13,45,20);
		LocalDateTime dt4=date.atTime(time);
		LocalDateTime dt5=time.atDate(date);
		
		System.out.println(dt5.getYear());
		
//		int year=date.getYear();
//		Month month=date.getMonth();
//		int day=date.getDayOfMonth();
//		DayOfWeek dow=date.getDayOfWeek();
//		int len=date.lengthOfMonth();
//		boolean leap=date.isLeapYear();
//		
//		System.out.println("year:"+year);
//		System.out.println("month:"+month);
//		System.out.println("month:"+month.getValue());
//		System.out.println("day:"+day);
//		System.out.println("dow:"+dow);
//		System.out.println("dow:"+dow.getValue());
//		System.out.println("len:"+len);
//		System.out.println("leap:"+leap);
		
//		int year=date.get(ChronoField.YEAR);
//		int mouth=date.get(ChronoField.MONTH_OF_YEAR);
//		int day=date.get(ChronoField.DAY_OF_MONTH);
//		System.out.println("year:"+year);
//		System.out.println("mouth:"+mouth);
//		System.out.println("day:"+day);
		
//		System.out.println("hour:"+time.getHour());
//		System.out.println("minute:"+time.getMinute());
//		System.out.println("second:"+time.getSecond());
		
		
		
	}
}
